Skip to content

fix(objectql,metadata-protocol)!: a stored row bound to a package lives in that package's own registry slot, so each address serves its own row in every order (ADR-0150 D3/D4) - #33513

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/area-E1-33127
Nov 15, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/area-E1-33127

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Elon · project thread

Part of #33127 (its main case and the per-package overlay slot; the card stays open for its unpinned heal items: Heal 1, Heal 2 and S1)
Fixes #32900
Fixes #32663
Fixes #32662
Refs #32692

Clause-②: yes (narrowing)
Metadata-protocol: semantic
Skills-docs: none — skills/** and content/docs/** teach no reading of a name two packages each store a row of (grepped ?package=, .custom, 409: the hits are the pair's save door, a flow's secret refusal and a permission grant), so no taught sentence moves; the read naming no package keeps its 409 and its ?package= remedy.

维护者速读

What changes

SchemaRegistry kept ONE bare slot per name for a stored row (registerItem with no package), so the row saved or hydrated last took it, beside the code artifact's composite pkg:name entry. Every symptom in this set is that one slot.

The slot model (packages/objectql/src/registry.ts).

  • registerItem(type, item, keyField, packageId?, options?) takes options.storedRowPackage. Without a packageId, a row with a stored-row package registers under a package overlay slot key, MARK + package + MARK + bareKey, with MARK the NUL character written as an escape in source. It never overwrites the bare key or a composite entry.
  • bareSlotEntriesOf reads those slots after the bare entries, so every reader that judged the bare slot (overlaySlotBinding, packageScopedHoldersOf, getPackageScopedItem, boundServedActions, unregisterItem) sees each row once, bound by the same rule as before.
  • rankedForPackage orders a package's bound rows as the stored-row read serves them: its pair's declared override, its own row, the package-less row, any other.
  • orderedOverlayTier orders the overlay tier of getItem by holder (the caller's package first, then composite order, then id), so getItem no longer follows row order.
  • overlaySlotBinding: a BASE.custom row whose base holds the name only as its own stored row binds to the base, never becoming a second holder. That is the case one bare slot never held both rows of.
  • isBundleAddition(…, codeMembersOf): a bundle member that two packages hold only as stored rows is no clash. One bare slot used to hold one of the two rows, so the base held the name in either order (protocol-bundle-member-base-address.test.ts pins that answer, and it went red without this). A member either package ships in code still clashes.
  • removePackageOverlaySlots(type, name, member, select) is new and public. It drops the selected packages' slots, for the delete's heal.

Hydration (packages/metadata-protocol/src/protocol-registry-hydration.ts).

  • hydrateOverlayIntoRegistry passes storedRowPackage for a row bound to a package of a type in PACKAGE_SLOTTED_STORE_TYPES, less flow and permission, which keep their own slot rules (takesPackageOverlaySlot).
  • Such a row records no sole-holder envelope. Its slot is its package's own.
  • restoreArtifactRegistryView retires the removed package's slot. Tier 1's bare-entry drop runs only when no slot was retired, and a heal with an unknown binding drops the slots of packages with no remaining row.

Reads (packages/metadata-protocol).

Moved answers (FROM main d4fbb4d → TO), per door:

Door FROM TO
GET /meta/TYPE/NAME?package=ID, two shippers each with a stored row (tool, webhook, agent, skill), after a restart own row only for the holder hydrated last; the other its shipped item each holder its own row
getPackageScopedItem, writer and peer, after alpha then beta saved (action, tool, email_template) [null, beta] (mirror in the other order) [alpha, beta]
GET /meta/TYPE/NAME?package=ID.custom, name held only as stored rows (dashboard, tool, action), before a restart 404 for both its base's row
same, after a restart 200 for the row hydrated last, 409 naming one side for the other its base's row
GET /meta/TYPE/NAME (and /published), a package's row beside its own pair's undeclared row plain: the pair's row when it was saved first the package's own row, both orders
GET /meta/action/NAME, two packages hold it only as stored rows, after a restart 200 the row hydrated last 409 RESOURCE_CONFLICT naming both (the narrowing)
getPackageScopedItem('email_template', welcome, X, 'de-DE'), X's pair row beside a package-less de-DE row the row hydrated last X's pair row, both orders
getPackageScopedItem('action', …), both shippers with a declared override (#33131's carried face) the last-saved holder's override; the other its shipped action each holder its own override

ADR-0087: the semantic entry stored-row-own-package-slot (packages/spec/src/migrations/entries/semantic/18.stored-row-own-package-slot.ts), marker adr-0087: registered stored-row-own-package-slot in .changeset/33127-stored-row-own-package-slot.md.

Tests

Head 8d85d2b1af. Pins, each in every registration, save and row order, with CONTROLs (one holder, one row, a package-less row: unchanged). Each pin went in as a top-level describe in the file that already holds its harness.

  • packages/objectql/src/webhook-stored-row-boot-hydration.test.ts:

    • [#33127] covers tool, webhook, agent and skill: both holders ship the name, each stores a row. It checks the registry slot, the exact read, and that the read naming no package answers 409 RESOURCE_CONFLICT naming both.
    • [#32900] checks X's de-DE slot in both row orders.
  • packages/objectql/src/protocol-cluster-signal-package.test.ts, [#32663]: action, tool and email_template, writer and peer, both save orders.

  • packages/runtime/src/domains/meta-disabled-holder-served-stack.test.ts, [#33127, #32662], through HttpDispatcher on a booted kernel over a sqlite file, before and after a reboot:

    • ?package= per holder;
    • each pair address ?package=ID.custom;
    • scope note (b), plain read and /published.

    The [#32607 M1] test now also pins the base row on all three faces in both orders.

  • Moved pins:

    • protocol-flow-custom-override.test.ts [#33131]: the carried registry face moved to its TO.
    • protocol.register-item-call-sites.test.ts: the ledger records the new registerItem call shape.
    • scripts/engine-double-contract.pinned.json: ratcheted with --write.
Local runs (under `scripts/pm/os-verify-lock.sh`)
  • Targeted: objectql, 4 files, Tests 144 passed (144); runtime served-stack, Tests 36 passed (36); metadata-protocol call sites, Tests 5 passed (5).
  • Typecheck of objectql, metadata-protocol, runtime and spec: TC_EXIT=0.
  • pnpm exec turbo run test --concurrency=2 --continue over the 83 packages that depend on objectql, metadata-protocol or runtime, plus @objectstack/spec. Result: Tasks: 186 successful, 188 total. The two failed tasks:
    • @object-ui/example-schema-catalog#test printed sh: 1: vitest: not found. That example's install is missing on this box; nothing was measured (NOT MEASURED).
    • @objectstack/dogfood#test (the full battery, no shard): Test Files 2 failed | 463 passed | 3 skipped (468), Tests 2 failed | 3930 passed | 42 skipped (3974). Both failures were Test timed out in 5000ms while the box was contended: bare-name-one-holder-ai-family [#31985] and package-commit-revert-path-package [#29414] control. Re-run alone under the lock (VERDICT command-exit 0): Test Files 2 passed (2), Tests 39 passed (39).
  • The 39 packages affected only through the new spec migration entry are left to CI.
  • pnpm lint passed (LINT_EXIT=0).
Ablations: one per negative pin, each restored with a clean whole tree

Each mutation went through scripts/ablation-replace.mjs. metadata-protocol was rebuilt and scripts/ablation-dist-preflight.mjs found the marker in dist/. After the restore it was rebuilt again and the preflight with --absent answered exit 0.

  • The hydration's overlaySlot forced off (marker ABLATION_33127_SLOT):
    • objectql: 27 failed | 117 passed (144). The red tests are exactly the [#33127] boot pins (16), [#32663] (6), [#33131]'s moved pin (4) and [#32900] pair-first (1).
    • runtime: 2 failed, the two #33127 door pins.
    • All CONTROLs stayed green.
  • readMetaItem's storedRowBases off: runtime 4 failed, the four #32662 pair-address pins. objectql stayed green.
  • storedRowHoldersRefusal's one-holder arm off (marker ABLATION_33127_PLAINB): runtime 3 failed, the two #32662 (b) pins and M1.
  • isBundleAddition's row-only exemption off: objectql 1 failed, [#28802] with a dependent's member at the same locale, the base's address still serves the pair's.

Acceptance notes

Verification

🤖 Generated with Claude Code

https://claude.ai/code/session_016WV4cy1y7UNVbT2QAdmgdn

…es in that package's own registry slot (ADR-0150 D3/D4)

The registry kept one bare slot per name for a stored row, so the row
saved or hydrated last took it. Each row bound to a package (its own, or
its .custom pair's by the pair-row rule) of a type the registry reads by
package now registers in that package's overlay slot, beside the code
artifact's composite entry, which it never overwrites.

- each package's exact read and registry item answer its own row in every
  registration, save and row order, before and after a restart, on the
  writer and on its peers;
- a pair address of a name held only as stored rows answers its base's row;
- the read naming no package of a package's row beside its pair's
  undeclared row serves the package's own row in both orders;
- the read naming no package of an action two packages hold only as
  stored rows refuses 409 naming both after a restart, as every other type
  already did (the narrowing);
- a bundle member two packages hold only as stored rows is no clash, as
  when one slot held one of them.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4cy1y7UNVbT2QAdmgdn
…ngine-double ledger

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4cy1y7UNVbT2QAdmgdn
@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 3 package(s): @objectstack/metadata-protocol, @objectstack/objectql, @objectstack/spec, touching 39 documentable anchor(s).

36 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json e40cd1e28dd79e60e7f4be0db06f071f3f962574.

⛔ 15 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • 1 anchor(s) matched too much of the corpus to be a work list: /meta/:type/:name (route, 48 pages)
  • 3 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 65 of 247 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 123 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 175 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json e40cd1e28dd79e60e7f4be0db06f071f3f962574 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from fd04e4b7fbb4da7048b3f0ec2955ea834760171e — the merge of head 8d85d2b1afb2d6e89d6c28ee0f3aa64c9b427585 into base e40cd1e28dd79e60e7f4be0db06f071f3f962574, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin fd04e4b7fbb4da7048b3f0ec2955ea834760171e && git checkout fd04e4b7fbb4da7048b3f0ec2955ea834760171e
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin e40cd1e28dd79e60e7f4be0db06f071f3f962574 8d85d2b1afb2d6e89d6c28ee0f3aa64c9b427585 && git checkout -B drift-repro e40cd1e28dd79e60e7f4be0db06f071f3f962574 && git merge --no-ff 8d85d2b1afb2d6e89d6c28ee0f3aa64c9b427585

node scripts/docs-audit/affected-docs.mjs --json e40cd1e28dd79e60e7f4be0db06f071f3f962574

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs e40cd1e28dd79e60e7f4be0db06f071f3f962574 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · os-elon-musk · session_016WV4cy1y7UNVbT2QAdmgdn

Request: review · area E1 · head 8d85d2b · 2026-11-14T23:16Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Contract-review-claim: session_016WV4cwxS1ZpSu2hAMRcqbt · head 8d85d2b · 2026-11-14T23:16Z

review#1 (E1) takes this head.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 8d85d2b1afb2d6e89d6c28ee0f3aa64c9b427585
Local-runs: none
Scope: packages/spec/src/migrations/entries/semantic/18.stored-row-own-package-slot.ts + packages/objectql/src/registry.ts, packages/metadata-protocol/src/protocol-registry-hydration.ts, packages/metadata-protocol/src/protocol-exact-qualifier.ts, packages/metadata-protocol/src/protocol-meta-item-face.ts, packages/metadata-protocol/src/protocol-meta-item-reads.ts, packages/metadata-protocol/src/protocol.register-item-call-sites.test.ts, packages/objectql/src/protocol-cluster-signal-package.test.ts, packages/objectql/src/protocol-flow-custom-override.test.ts, packages/objectql/src/webhook-stored-row-boot-hydration.test.ts, packages/rest/src/meta-disabled-holder-served-stack.test.ts, scripts/engine-double-contract.pinned.json, .changeset/33127-stored-row-own-package-slot.md, .changeset/33127-stored-row-own-package-slot-semantic-entry.md (read, not reviewed: registry readers that walk raw keys — bareNamePackageHolders, securityCatalog*, listItems; plugin-webhooks declared-webhooks.ts slotsOf; runtime action-execution.ts listItems consumers)

Face: schema (a packages/spec/src/** hit). Diff read against merge base e0ce1b52. Cards #32900, #32663, #32662, #33127 and #33131 (with every comment) read.

① Derived judgments

  • Slot model. A stored row of a package-slotted type (PACKAGE_SLOTTED_STORE_TYPES minus flow and permission) that is bound to a package now registers under NUL pkg NUL bareKey (registerItem's storedRowPackage). A package-less row keeps the bare slot, and code artifacts keep pkg:name. Raw-key readers outside the PR were checked against the new key form. bundleBaseKey, bareNamePackageHolders, the security-catalog scans and the :name suffix scans neither match an overlay key nor count it as a holder (no : in it, never equal to a bare name), as the OVERLAY_SLOT_MARK docblock claims.
  • Readers moved with it. bareSlotEntriesOf appends the overlay slots, so getPackageScopedItem, holders and overlaySlotBinding see every stored row. getItem reads bare, then overlays (orderedOverlayTier: the caller's package first, then composite-holder order, then id), then composites. That is the same precedence the bare slot had over composites, now independent of registration order. rankedForPackage mirrors servedOverlayRowCandidates' order (declared override of the pair, own row, package-less, other bound). boundServedActions lets one overlay per (holder, name) shadow that holder's composite, as the bare slot shadows every composite. unregisterItem removes one package's overlay group before falling to composites, and removePackageOverlaySlots retires only the removed row's package slot.
  • Hydration and heal. hydrateOverlayIntoRegistry passes storedRowPackage only for the slotted types. The sole-holder envelope record is skipped for overlay-slot keys, which is correct because the bare key is untouched. The delete heal retires the bound slot and leaves the package-less bare row alone. A peer with an unknown binding retires every slot that no remaining row is bound to.
  • Protocol reads. admitExactQualifier's storedRowBases admits a pair address at the one base whose stored row holds the name. Two such bases are refused by exactQualifierItem as two registry bases are. It is asked only by the plain item read. storedRowHoldersRefusal serves the one holder whose rows are its own plus its pair's (scope note (b)).
  • Downstream consumers. listItems(type) now yields one row per bound package where it used to yield the last one. plugin-webhooks resolves slots through getPackageScopedItem / packageScopedHoldersOf (slotsOf), and runtime's listItems('action') consumers filter by _packageId stamps that the rows already wore. Neither keys on the bare slot, so neither double-counts.
  • Pins. The #33131 S1 "(carried)" pin is flipped: each holder's registry item is now its own override, in 2 × 2 orders. Webhook, tool, agent and skill boot cover 2 holders in every registration and row order, with CONTROLs (one row, one holder). metadata-protocol: the registry's bare slot keeps only the row hydrated last when a pair row and a package-less row of the same member are both stored #32900 covers both row orders plus CONTROLs. There is also a cluster-signal peer pin and REST served-stack pins. engine-double-contract.pinned.json goes 2 → 4, which grows the pinned population and loosens nothing.
  • CI on this head at review time: 23 success, 13 skipped, 31 in progress. PR-body guards had FAILED, which the author attributes to the folded cards' claim comments and has re-patched. Landing needs every check green on the landing head.

② Semver level

Clause-②: yes (narrowing) is right. The diff widens @objectstack/objectql's exported SchemaRegistry (an optional fifth registerItem argument and the public removePackageOverlaySlots) and narrows one answer: an action two packages hold only as stored rows, read with no package after a restart, goes from 200 (the last hydrated) to 409 naming both, matching #32607. A diff that widens and narrows takes yes (narrowing) (AGENTS.md Post-Task Checklist step 3). Metadata-protocol: semantic is right, because which stored row each package's address serves changes and no key moves. @objectstack/objectql and @objectstack/metadata-protocol are minor, @objectstack/spec is patch (none), and adr-0087: registered stored-row-own-package-slot.

③ Boundary flags

  • Not governed (no Tier H path); 737 lines, under the 3000-line bound. The PR is authored by objectstack-fleet[bot] on the relay.
  • N1 (nit, performance): for a non-bundle type, getItem (bare miss) and bareSlotEntriesOf now walk the whole collection (overlaySlotEntriesOf) where they used to answer from one Map.get. The callers are metadata reads, not per-record paths, so this is bounded. A per-type count of overlay keys, skipping the walk at zero (the common case), would restore O(1).
  • N2 (nit): getItem(name) with no package and two packages' overlay rows now picks by composite-holder order instead of save order. Internal callers that use it as a baseline (protocol-save.ts baseline, the authoring gate's declared body) get a deterministic but still arbitrary pick. That is no worse than before, since the doors themselves refuse 409, but a short comment at those two callers would keep a later reader from relying on it.
  • N3 (nit): boundServedActions splits its group key on the last :. Safe for action names today; a tuple key would not depend on it.

④ Design judgment

18.stored-row-own-package-slot.ts holds against ADR-0150 D3/D4 ("registry overlay slot (ADR-0005)": a stored row bound to a package is that package's item) and red line 2. Its surface, replacement and acceptanceCriteria name every moved read, including the peer replica and the pair address, and give the operator's remedy (?package=ID). The registry change agrees with it: the one-bare-slot model was the root of every order-dependence named in #33127, #32663, #32662, #32900 and the #33131 carried face, and each now has a pin in both orders. The exclusions (flow, which keeps #28717's declared-override slot rule, and permission, which keeps its fork ruling) are reasoned in takesPackageOverlaySlot. No must-fix or should-fix; N1–N3 are nits. This is the final round.

#33131 (asked by the author): this PR closes that card's remaining carried face (comment 6870666736, the both-overridden registry item), and the flipped pin proves it. Two items are still open on the card (comment 6878816309): nit N1 of record 6878787461 (unmeasured), and the doc bare-read registration-order pick, which is out of this PR's types. So this PR alone does not finish #33131. Keep Refs #33131, or file one loose-ends card carrying those two items, link it on #33131, and then write Fixes #33131.

Implemented-by: claude/area-E1-33127
Reviewed-by: session_016WV4cwxS1ZpSu2hAMRcqbt

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · os-elon-musk · session_016WV4cy1y7UNVbT2QAdmgdn

ACCEPT · area E1 · 2026-11-14T23:22Z

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 14, 2026 23:23
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 14, 2026
Merged via the queue into main with commit 728be58 Nov 15, 2026
71 of 72 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/area-E1-33127 branch November 15, 2026 03:23
scbdzhwl pushed a commit to scbdzhwl/objectstack-analysis that referenced this pull request Nov 16, 2026
…object as served, refusing a bad follow pair at the run that completes it (objectstack-ai#33621)

<!-- claude-projects-attribution: {"github_login":"os-elon-musk"} -->
_Requested by **Elon** · [project
thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9DEdLnXfTK9TPVHPSUQcDnQS)_

Fixes objectstack-ai#33593

Clause-②: yes (narrowing)
Metadata-protocol: narrowed
Skills-docs: none — `skills/objectstack-data/rules/field-types.md`
already teaches the follow pair with no extension exemption; an
extension now meets that same rule, so the docs do not move.

## 维护者速读

- **改了什么**:扩展包(`objectExtensions` / `object_extension`)新增的 record
币种金额字段,现在按"对象实际对外服务的样子"(基础层 + 已启用扩展 +
本次正文)判定其跟随的父对象币种字段;运行结束、批量写入、单条保存三处同一规则。
-
**为什么改**:以前扩展层只判自己的汇总字段就提前返回,坏的跟随对(父字段无币种码、字段不存在、经扩展自建的主从字段)被放行,之后父对象的无改动升级反而被
422 拒绝,错怪了无辜的包。
- **风险与回滚**:收紧(narrowing)——此前能装上的坏扩展现在 422;无改动升级不再因"旧坏对"被拒(放宽)。回滚即回退本
PR;无存量数据迁移(维护者 2026-11-14:暂无生产客户)。另:`object_extension` 单条保存现在同时经过 D6
汇总门(两个方向),此前存下后只告警的币种汇总改为 422。
- **先看**:`packages/objectql/src/registry.ts` 的
`recordCurrencyFollowRefusalOf` /
`servedFoldWithLayer`(折叠与"之前"对比);`packages/objectql/src/record-currency-aggregate-door.ts`
的
`recordCurrencyFollowRefusal`(差分判定);`packages/metadata-protocol/src/protocol-save.ts`
新增的 `object_extension` 单条保存提问。
- **两分钟验证**:`pnpm --filter @objectstack/objectql exec vitest run
--project local src/manifest-service-artifact-refusal-restores.test.ts
src/protocol-batch-object-registration.test.ts`,预期全绿,其中 `[objectstack-ai#33593]` 两个
describe 覆盖 R1–R7。
- **需要你做的**:契约复审(`Metadata-protocol: narrowed`)一次;R7 范围已由席位 5 裁定为 A(只管
install/upgrade/reload 这类 run)。

## What changes

The record-currency follow door (ADR-0144 D2 and D6, amended) asked an
`extend` layer with `partial: true`, judged only its own roll-ups, and
returned before the following-amount half and the other-ends half. An
extension-only package could therefore add a record-mode amount
following a parent field with no ISO 4217 code, a missing field, or a
field reached through its own new master_detail, and it was admitted and
served; a later no-change upgrade of the parent's owner was then refused
422 over the extension's field.

Implementing the seat ruling (A, amended), R1–R7:

- **R1 — every layer judged as the served fold.**
`SchemaRegistry.recordCurrencyFollowRefusalOf` now builds the object as
`resolveObject` would serve it with the incoming layer in its slot
(`servedFoldWithLayer`: one owner, one overlay, one extension per
package; a disabled package's extension withheld, as the served fold
withholds it) and hands that fold to the door. The door's `partial` and
`extensionFieldsOf` are gone: the fold already holds every enabled
extension's fields, so the own-body loop and the other-ends loop both
read them.
- **R2** — an object no owner serves yields no fold, so no verdict
(unchanged).
- **R3** — no order is exempt: the owner registering after an extension
judges the extension's amounts as its own (the fold), at run end, in the
batch writer and on single save.
- **R4** — an extension arriving before the parent's code field exists
is refused like an own body.
- **R5** — the followed field is read from the served parent: a missing
or disabled supplier extension means refusal; the same supplier in the
same artifact passes at the run end.
- **R6** — a parent upgrade that removes or de-codes a followed field is
refused; when the amount is an extension's, the sentence now names it:
`'PARENT' does not hold the code a registered amount follows:
'CHILD.FIELD', which package 'PKG' adds to 'CHILD'.` followed by the
door's own words. New view member `extensionPackageOf`.
- **R7** — a no-change upgrade is never refused. The door now takes a
`before` reading (the object served with what the layer's slot held
before) and refuses only a refusal that reading does not already hold.
At run end `before` is the contributor the run replaced
(`RunRegisteredObject.replaced`, captured in `registerObject`, the
earliest kept when a run writes one slot twice); on single save and in
the batch writer it is the slot left empty, so a pair the layer itself
completes is still refused. The two readings are compared by PAIR, not
by sentence: the key is the kind, the declaring object and field, and
the target (for a following amount the object its master_detail reaches
plus the pointer; for a roll-up the child object and field), so an
upgrade that re-points the master_detail onto another parent lacking the
code makes a new pair and is refused: for the child's owner as on
`main`; for an extension package re-pointing its own master_detail this
moves FROM installed (`main` never asked an extension layer's following
half) TO refused 422.
- **Single save of an `object_extension` item** never asked the follow
door (measured on this branch before the hunk: the published save
answered 200 and served the bad amount). `protocol-save.ts` now asks
`objectRegistrationRefusal(..., 'extend', { againstRegistry: true })`
for a published `object_extension` save on an against-registry face
(`saveRegistryQuestion`), the same faces that ask it of an `object`
body.
- Changeset (minor: objectql, metadata-protocol, spec) with `registered
record-currency-follow-extension-judged-as-served`, a new semantic
ledger entry.

### Clause-② table (each moved answer FROM → TO)

Orders: **A** = owner and parent installed first, extension after; **B**
= extension first (no verdict while nothing owns the object), owner
after.

| Case | Order | Run end | Batch writer | Single save |
|---|---|---|---|---|
| extension amount follows a parent field with no code | A | admitted →
refused 422 | admitted → refused 422 | admitted (door never asked) →
refused 422 |
| extension amount follows a missing field | A | admitted → refused 422
| admitted → refused 422 (same door, not pinned separately) | admitted →
refused 422 (same door, not pinned separately) |
| extension amount through its own new master_detail | A | admitted →
refused 422 | admitted → refused 422 (same door, not pinned separately)
| admitted → refused 422 (same door, not pinned separately) |
| owner registering under a bad extension | B | admitted → refused 422 |
admitted → refused 422 | admitted → refused 422 |
| supplier extension missing / disabled | A | admitted → refused 422 |
not pinned | not pinned |
| parent upgrade removes / de-codes a followed field | — | refused →
refused (sentence names the extension's package and field) | not pinned
| not pinned |
| no-change upgrade over a pair a cold boot admitted | — | refused 422 →
installed | unchanged (main's empty-slot answer) | unchanged (main's
empty-slot answer) |
| unchanged child under a parent's `record` roll-up a cold boot admitted
| — | refused 422 → installed | unchanged (main's empty-slot answer) |
unchanged (main's empty-slot answer) |
| extension package's own no-change upgrade over an amount a cold boot
admitted | — | (newly judged) → installed | n/a | n/a |
| parent upgrade that only adds an unrelated code field, pair unchanged
| — | refused 422 → installed (pair compared, not the sentence) | n/a |
n/a |
| upgrade of the child's owner that only re-points the pair's
master_detail onto another parent lacking the code, pointer string
unchanged | — | refused 422 → refused 422 (unchanged; the pair key names
the followed object) | n/a | n/a |
| upgrade of an extension package that only re-points its own
master_detail onto another parent lacking the code, pointer string
unchanged | — | installed (`main` never asked an extension layer's
following half) → refused 422 (the pair key names the followed object) |
n/a | n/a |
| re-publish of an UNCHANGED extension whose amount a cold boot admitted
| — | n/a | saved → refused 422 | saved (200) → refused 422 |
| `object_extension` adding a `sum`/`avg`/`min`/`max` roll-up of a child
amount declared `currencyMode: 'record'` (in each row's own currency, or
following a parent's code but not read on that parent through the
master_detail it follows), or adding such an amount that a registered
parent's roll-up reads (D6's roll-up door, both directions) | — |
unchanged | unchanged (already asked) | stored, 200, registration warned
→ refused 422, nothing stored |

FROM readings: run end measured on `main` by the area's earlier report
(M1–M3 admitted, C2 refused) and by the two pins this PR flips; single
save measured on this branch before the `protocol-save.ts` hunk; batch
writer FROM read from `main`'s door (`partial` returns before the
following half), not separately measured.

CONTROLs (unchanged, pinned): the same amount in an own object body is
refused 422; a package that owns the parent and extends the child in one
install is refused 422; an extension following the parent's code
installs and is served.

## Tests

New top-level describes:

- `manifest-service-artifact-refusal-restores.test.ts` — `[objectstack-ai#33593] an
extension's record-mode amount is judged against its object as served,
at the end of the run`: the three bad shapes (refused 422 + nothing
left), CONTROL good extension, CONTROL own body, CONTROL parent +
extension together, R3 both orders, R4, R5 missing / disabled / same
artifact, R6 removal and de-code (sentence names the package and field),
R6 an extension upgrade re-pointing its own master_detail onto another
bad parent (refused), R7 no-change upgrades of both owners.
- `protocol-batch-object-registration.test.ts` — `[objectstack-ai#33593] an
extension's record-mode amount on a single save and in the batch
writer`: published `object_extension` save on `meta-envelope` refused
422 and nothing stored (plus CONTROL), the owner's single-save question
in order B, and the batch writer's registered-row question asked of both
ends (plus CONTROL).

Moved pins (Clause-② evidence, both renamed with the ruling id): `a
package that holds only the parent ... upgrade that changes nothing` and
`a package that holds only the child installs an unchanged child under a
record roll-up` now install (R7); a new CONTROL pins that the child's
upgrade that CHANGES the pair under that roll-up is still refused, and
another that a child upgrade re-pointing its master_detail onto another
bad parent (same pointer string) is still refused. The extension
package's own re-point
(`manifest-service-artifact-refusal-restores.test.ts:982`, not a
CONTROL) is a moved answer: installed on `main`, refused 422 here.

## Acceptance notes

- **Review #3 delta-2 (comment 6889470504) fixes, at `31e745afc`, text
only:** M1: the changeset's re-point sentence now scopes "as before" to
the child's owner and says the same re-point upgrade of an extension
package moves FROM installed (`main` never asked an extension layer's
following half) TO refused 422; this table splits that row in two and
the R7 bullet says the same. The TO is held by the existing pin
`manifest-service-artifact-refusal-restores.test.ts:982`. N1: the
changeset's R7 parenthetical now gives the key for a following amount
and for a roll-up (the declaring object and field, and the child object
and field it reads). No code changed; `check:adr-0087-registration`,
`check:spec-changes`, `check:upgrade-guide`, `check:empty-changeset`,
`check:changeset-fixed`, `check:nul-bytes`: exit 0.
- **Review #3 delta (comment 6888891782) fixes, at `c29899531`:** M1
(text): the changeset's D6 line, this table's last row and the entry's
`surface` now say the child amount is declared `currencyMode: 'record'`
(in each row's own currency, or following a parent's code but not read
on that parent through the master_detail it follows), and name D6's
second direction (a registered parent's roll-up over an amount the
extension adds); the `registry-question.ts` header says the same. M2
(code + pin): the `follow` pair key now carries the object the pointer's
master_detail reaches (`record-currency-aggregate-door.ts:596`, `:615`);
pinned at `manifest-service-artifact-refusal-restores.test.ts:601`
(child upgrade re-pointing `invoice` from `suite_invoice` to
`suite_other`, refused 422, Billing stays at 1.0.0) and `:982` (the
extension's own `inv2` re-pointed, refused 422). Ablation of the
own-loop key back to the bare pointer turns exactly those two pins red,
restored to HEAD. S1: the BREAKING paragraph names the roll-up author,
and the fix sentence and the entry's `replacement` carry D6's remedies.
Nits: N1 (below), N2 ("the first four lines") and N3 (single save 200,
batch writer "saved" in its own result) fixed; round-1 nits N1-N3 left.
- **Review #3 (comment 6888559585) fixes, at `f1f49b351`:** M1 declared
(option a): the `protocol-save.ts` hunk asks D6's roll-up door as well
as the follow door, as the batch writer's extension row already did; the
changeset, this table, the entry's `surface` and the
`registry-question.ts` sentence now say so, and a pin holds it (422,
nothing stored). M2: R7 compares the refused pair (kind, object, field,
pointer or roll-up target), not the sentence, which lists the parent's
code fields; pinned: a parent upgrade that only adds `cc` installs. M3:
pinned: the extension package's own no-change upgrade installs (ablation
of the extend arm's `replaced` capture turns exactly that pin red,
restored to HEAD). M4: the changeset scopes R7 to runs and adds the
unchanged-extension re-publish line for single save and the batch
writer.
- **Verification at `f1f49b351`:** `pnpm --filter @objectstack/objectql
typecheck && pnpm --filter @objectstack/objectql test` under
`os-verify-lock`: Test Files 595 passed (595), Tests 13099 passed
(13099), VERDICT command-exit 0. The two touched test files: 65/65.
`check:adr-0087-registration`, `check:spec-changes`,
`check:upgrade-guide`, `check:nul-bytes`, `check:doc-authoring` and
eslint over the 7 touched source files: exit 0.
- **Main merge:** `origin/main` (with E1's objectstack-ai#33513) merged at
`fb22e7bd1`, clean, no conflict in `registry.ts`; the PR's hunks were
byte-identical before and after (review #3 checked the same).

- **Follow-up: objectstack-ai#33628** (R5 / enable): whether uninstalling or disabling
a supplier extension, and enabling a package, ask the follow door is NOT
pinned here. By reading: `disablePackage` / `enablePackage` /
`uninstallPackage` are not registration runs (`restoringOnRefusal` is
not entered), so none asks the door; a disable that withholds a
supplier's code field leaves a following amount served against a parent
that no longer holds the code.
- **Batch writer face** is pinned at the registry question the writer
asks of a registered row (`objectRegistrationRefusal(..., {
againstRegistry: true })`, as `batch-object-registration.ts` asks it),
not by driving a protocol batch face end to end with an
`object_extension` row.
- **Decided (seat 5): A.** R7 covers runs (install, upgrade, reload).
Single save and the batch writer are unchanged: they judge against the
slot left empty, `main`'s answer, so a single save that re-saves an own
body unchanged over a pair a cold boot admitted is still refused.
- **Environment-overlay reading** (`followRefusalAsServed`): an
extension layer's own fold uses the served base (the overlay when there
is one); only the OTHER objects are re-read through their package
definitions.
- **Older ledger entry:**
`18.record-currency-follow-pair-refused-on-install-and-reload.ts` is not
edited (a registered entry). The new entry
`18.record-currency-follow-extension-judged-as-served.ts` names it and
says that, for runs, it supersedes that entry's sentence "although
nothing in that package is wrong": such a run is now refused only when
it changes the pair.
- `packages/metadata-protocol/src/registry-question.ts` (E1's file,
edited here with E1's OK): one header sentence, comment-only: "An
`object_extension` item published on the same faces asks both
record-currency doors too — D6's roll-up half (the roll-ups it adds, and
a registered parent's roll-up over an amount it adds), and the follow
door of the extension judged as its object will be served."

## Verification

<details><summary>Review #3 delta fixes at `c29899531` — objectql full
suite + typecheck green, ablation 2 red, gates 0</summary>

`pnpm --filter @objectstack/objectql typecheck && pnpm --filter
@objectstack/objectql test` under `os-verify-lock`, after `pnpm --filter
'@objectstack/objectql^...' build`:

```text
check:test-typecheck: OK — @objectstack/objectql's test layer compiles under packages/objectql/tsconfig.test.json
 Test Files  595 passed (595)
      Tests  13101 passed (13101)
os-verify-lock: VERDICT command-exit 0
```

The two touched test files: 67/67. `packages/spec` migrations tests
(`migrations`, `semantic-relevance`, `spec-changes-surface-scope`):
187/187.

Ablation: `node scripts/ablation-replace.mjs --file
packages/objectql/src/record-currency-aggregate-door.ts` replacing the
own-loop key's target with the bare pointer, then the two test files:

```text
ablation-replace: ok mutation landed: anchor 1 -> 0, blob b6542b7 -> 97bc3261cc65
     x [objectstack-ai#33593 R6] CONTROL: the child's upgrade that re-points the pair onto ANOTHER parent lacking the code is refused, though the pointer reads the same
     x R6: an extension upgrade that re-points its own master_detail onto ANOTHER parent lacking the code is refused, though the pointer reads the same
      Tests  2 failed | 65 passed (67)
ablation-replace:   blob after restore  b6542b7   (== HEAD blob; git diff HEAD empty)
```

Gates: `pnpm check:adr-0087-registration` exit 0; `pnpm --filter
@objectstack/spec check:spec-changes` exit 0; `check:upgrade-guide` exit
0; `check:nul-bytes` exit 0; `eslint --no-inline-config` over the four
touched source/test files exit 0. Dogfood battery and dependents: not
run in this round (ordered after the delta review).
</details>

Readings below the first two blocks were taken at `bb54e3a54` (merge
base `c32bb6ccb`). The branch then merged `origin/main` at `fb22e7bd1`
(E1's objectstack-ai#33513 had landed): the merge was clean, with no conflict in
`registry.ts`. After `pnpm install --frozen-lockfile` and a rebuild of
objectql's dependency closure, objectql `tsc --noEmit` passed, the two
touched test files ran 62/62, and the full objectql suite was cut off by
a container restart (NOT MEASURED at `fb22e7bd1`).

<details><summary>objectql: full suite + typecheck — green</summary>

`pnpm --filter @objectstack/objectql test && pnpm --filter
@objectstack/objectql typecheck` (under `os-verify-lock`, at
`56474fc2f`; the source has not changed since except the JSDoc commit)

```text
 Test Files  595 passed (595)
      Tests  13049 passed (13049)
check:test-typecheck: OK — @objectstack/objectql's test layer compiles under packages/objectql/tsconfig.test.json
os-verify-lock: VERDICT command-exit 0
```
</details>

<details><summary>metadata-protocol: full suite + typecheck —
green</summary>

`pnpm --filter @objectstack/metadata-protocol test && pnpm --filter
@objectstack/metadata-protocol typecheck`

```text
 Test Files  340 passed | 9 skipped (349)
      Tests  22877 passed | 43 skipped (22920)
os-verify-lock: VERDICT command-exit 0
```
</details>

<details><summary>Ablation (one, the behaviour the new pins hold) — 8
red, restored</summary>

`node scripts/ablation-replace.mjs --file
packages/objectql/src/registry.ts --anchor "if (served === undefined)
return undefined;" --replacement "if (served === undefined || ownership
=== 'extend') return undefined;"` (an `extend` layer judged by nothing,
the shape `main` had for the following half), then the two test files.
objectql's tests import the registry from `src` by relative path, so no
build sits between the mutation and the run.

```text
ablation-replace: ok mutation landed: anchor 1 -> 0, blob 09c11d4 -> 3be4c89b9820
 Test Files  2 failed (2)
      Tests  8 failed | 54 passed (62)
  x the three extension-only bad shapes (R1), R4, R5 missing, R5 disabled, single save, batch writer
ablation-replace: ok restored: blob == HEAD (09c11d4) and `git diff HEAD` is empty
```

Direction as expected: the R3 cases (owner after the extension) stay
green under this mutation, because the owner's own layer folds the
extension in.
</details>

<details><summary>Lint and gates</summary>

- `npx eslint --no-inline-config` over the six changed files: exit 0.
- `pnpm check:adr-0087-registration`: exit 0, `registered
record-currency-follow-extension-judged-as-served (new here)`.
- Derived families (`node scripts/pm/dispatch-gates.mjs --commands`, 95
commands for 7 paths vs `c32bb6ccb`): run locally as of this body, all
exit 0 except the ones below; the rest are left to CI's `Lint & Repo
Gates` / `TypeScript Type Check`.
- re-run after `pnpm --filter @objectstack/spec build`:
`check:api-surface` (unchanged ✓), `check:exported-any`,
`check:browser-reachable-entries`, `check:dual-source-exports`,
`check:entry-nameability`: exit 0.
- `check:dual-build-cjs-loads`, `check:lean-entry-closure`: exit 3
(PREREQUISITE NOT MET: no whole-repo build here, nothing measured), NOT
MEASURED locally; CI runs them. `--ran`: 95 derived, 93 run, 2 UNRUN
(these two).
- After the two follow-up commits (the `registry-question.ts` sentence
and the new entry's supersede sentence): the derivation over 8 paths
gives the same 95 commands. `check:adr-0087-registration`,
`check:spec-changes`, `check:upgrade-guide`, `check:liveness`,
`check:nul-bytes`, `check:doc-authoring`, `check:issue-citations`,
`check:cross-package-test-inputs` and eslint over both files: exit 0.
- `test:repo` (vitest `repo` project, incl.
`packages/runtime/src/metadata-registry-question-producers.test.ts`):
NOT MEASURED locally, declared to CI's `Test Core`. The new
`saveRegistryQuestion` call in `protocol-save.ts` adds no `saveMetaItem`
/ `promoteDraftForPublish` producer.
- Direct dependents of objectql (runtime, rest, plugins): NOT MEASURED
locally (deadline), declared to CI.
- Full dogfood battery (title carries `!`): NOT MEASURED locally,
declared to the queue's `Dogfood Regression Gate`.
</details>

Session: https://claude.ai/code/session_016WV4cz4f7zEQZ2C9GTG382

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- signed: domain:server#5 · os-elon-musk ·
session_016WV4czrwT7WKAde95kC4cg -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
scbdzhwl pushed a commit to scbdzhwl/objectstack-analysis that referenced this pull request Nov 16, 2026
…r row's bare-slot entry when the pair relation names no single base (ADR-0150 D5) (objectstack-ai#33825)

<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} -->
_Requested by **Steedos** · [project
thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbNTugWasvhTMrtCZiFGrZYK)_
Fixes objectstack-ai#32620
Clause-②: no
Metadata-protocol: none

## 维护者速读

- 改了什么:租户删掉自己对"两个包同名项"的定制后,注册表修复(heal)现在会把该定制留在裸槽位里的条目清掉,不再挑任何一个包。
-
为什么改:此前删完后直到下次重载,点名该定制包的读取仍返回已删除的内容,点名两个原持有包的读取则被拒绝,且候选里是一个早已不存在的行(flow、permission
两种类型实测复现)。
- 风险与回滚:只改一处判断,清除动词本身仍拒绝删除打包制品,不会误删任何持有包的条目;回滚即 revert 本
PR,回到"记日志、条目保留、重载后自愈"。
- 先看:`packages/metadata-protocol/src/protocol-registry-hydration.ts` 中
`restoreArtifactRegistryView` 的 catch 分支(条件去掉 `boundPackageOf(packageId)
!== undefined`),再看
`packages/objectql/src/protocol-registry-heal-packageless-refusal.test.ts`
新增的 describe。
- 两分钟验证:`pnpm --filter @objectstack/objectql exec vitest run
--maxWorkers=2
src/protocol-registry-heal-packageless-refusal.test.ts`,预期 7 个用例全绿。
- 需要你做的:无,席位落地。

## What changes

Ruling: epic seat ruling 6818436831 (`epic:objectstack-ai#31527#2`), seat ruling A,
"extend the retire", on the same footing as seat ruling 6812637203 Q2.

A stored row bound to a **non-holder** (an installed package holding no
item of the name, ADR-0146) on a name two packages hold, where the pair
relation names zero or several bases: after its delete, the heal's
baseline read is refused and the walk stops with an `error` line. On
`main` the removed row's bare-slot entry was then kept. It is now
retired with `removeOverlayEntry`, the verb the package-less case (Q2)
already uses, which refuses a packaged artifact. No holder is picked and
no baseline is registered. **Declared move: entry kept → retired,
`Clause-②: no`.**

- `restoreArtifactRegistryView`'s catch: the retire no longer requires a
package-less row. A package-scoped refusal is the only refusal
`readHealBaseline` lets through for a bound row, and it reaches it only
after the row's own package answered a settled miss, so the row is a
non-holder's. A peer that does not know the binding
(`HEAL_BINDING_UNKNOWN`) keeps the logged stop, as before.
- `registryHealStoppedMessage` gains one case, `slot-retired`. For the
package-slotted types whose bound row lives in its own package slot
(objectstack-ai#33127), that slot is already retired above the catch, and the bare
slot holds nothing to remove. The line said "the registry entry is left
as it was and may serve the removed row". It now says the row's own
package slot was retired.
- No change to `protocol.ts`, the objectql registry, or any spec
surface.

### Which types reproduced at `a557fa38` (the premise, measured)

The measurement booted a real `SchemaRegistry` with a real
`MetadataManager` holding two holders' items, hydrated one stored row
bound to a non-holder, and then deleted it through `deleteMetaItem`
naming that package. It covered every `PACKAGE_SLOTTED_METADATA_TYPES`
member plus `dashboard` and `report`, in both registration orders, with
and without composite holder slots in the registry.

- **Reproduces: `flow`, `permission`**, with holders served by the
service and no composite slot in the registry. Before the delete, the
bare slot held `row:other`. After it, the bare slot still held
`row:other`, the read naming the non-holder served `row:other`, and each
holder's read was refused with the non-holder as its only candidate.
These are exactly the card's three bullets. These two types are the
package-slotted types excluded from `takesPackageOverlaySlot`, so their
bound row sits in the bare slot.
- **Does not reproduce:** `api`, `agent`, `skill`, `action`,
`email_template`, `picklist`, `mapping`, `dataset`, `webhook`, `tool`,
`connector`. objectstack-ai#33513 already retires the bound row's own package slot,
and the bare slot is empty. For these types only the line changes.
- With composite holder slots, nothing reproduces: either tier 1 heals
or the delete door refuses (403 `NOT_OVERRIDABLE`).
- **PM hypothesis 2 partly falsified.** `dashboard` and `report` never
reach this branch, because their store is not package-slotted and the
bare read is not refused (no heal line). `email_template` is clean. See
Acceptance notes for what `dashboard` and `report` do instead.

## Tests

-
`packages/objectql/src/protocol-registry-heal-packageless-refusal.test.ts`:
a new top-level describe on a real `SchemaRegistry`, sharing the file's
one engine double. It covers `flow` and `permission`, each in both
registration orders. Before the delete: the row is in the bare slot, and
a holder's read is the 409 naming the non-holder. After it: the bare
slot is empty, the non-holder's read serves nothing, each holder's read
answers its own item, the bare read is the 409 naming both holders, the
list shows the two holders only, and the line says the entry was
retired. CONTROL `action`: the holders serve exactly as before, and the
line says the row's own package slot was retired.
-
`packages/metadata-protocol/src/protocol.registry-heal-package-read.test.ts`:
the recording-double pin "a row of a package that pairs no holder, on a
name two packages hold" flips from `tier3: []` to `tier3:
['action|digest']` (the declared move). A sibling case covers the verb
answering `false`, where the line says no entry was retired.

**Ablation**, once: the fix was committed first, then the bound-row
exclusion was put back through `scripts/ablation-replace.mjs`, with a
marker that must reach `dist/`.

- objectql pins resolve `@objectstack/metadata-protocol` through
`dist/`, so the mutated package was rebuilt and
`ablation-dist-preflight` passed (exit 0) before the run. The mutated
run had **5 failed, 2 passed (7)**: all four flow/permission cases
failed with `expected 'row:other' to be undefined`, and the CONTROL
failed with `expected '[Protocol] the registry heal after th…' to
contain 'retired from its own package's slot'`. After the restore, `git
diff HEAD` was empty, the blob hash matched HEAD, the package was
rebuilt, and the dist marker was absent. The restored run was 7 passed.
- metadata-protocol pins resolve source. The mutated run had 2 failed,
15 passed (17); restored, 17 passed.
- The first objectql ablation leg was a no-op: the lock queue timed out
before the rebuild, and the preflight caught it (dist reading failed).
That run was discarded and redone as above.

## Acceptance notes

- `dashboard` and `report` (not package-slotted in the store), measured
only in the no-composite shape. After a non-holder row's delete, tier
2's bare baseline read returns one holder's item, the one the service
registered last, so the bare slot then serves that holder and the other
holder's read is refused naming it. This branch is not this card's (no
refusal, no heal line), and whether the no-composite shape is reachable
for those types in a real boot was not measured. It is recorded for the
seat, not filed.

## Verification

Readings at head `7fce425024` (origin/main merged in), unless stated:

- `@objectstack/metadata-protocol`: the whole suite passed, 340 files /
22884 tests, 9 files and 43 tests skipped, read at `6ba132b569`. The
merge then changed `protocol-save.ts` and `registry-question.ts`, so the
heal file was re-run at the head: 17/17. `typecheck` exit 0.
- `@objectstack/objectql`: `typecheck` exit 0. The objectql closure was
rebuilt after the merge, then the 29 test files that drive the delete
heal (`restoreArtifactRegistryView`, `deleteMetaItem`, or a heal line)
were run: 680/680 passed. The full objectql suite was NOT MEASURED
locally, because the shared verify lock queue-timed out twice. That run
is left to CI's `Test Core`.
- Derived gates (`dispatch-gates --commands`, 67 families): 66 exited 0.
`check:dual-build-cjs-loads` exited 3 with PREREQUISITE NOT MET (no
full-repo `dist/` in this worktree), so it is NOT MEASURED and left to
CI. `--ran` reconciliation: 67 derived, 67 run, 0 unrun.
- ESLint over the three touched source and test files exited 0. PR body
gates: `check-closing-keyword-parity` and `check-partof-closing-keyword`
exited 0.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01QsR2jTkZnXtRhuEiiyidvJ

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment